Defining the Scope of Your Printing Extension
When you write a printing extension, you must define the types of devices and drivers with which your extension is compatible. You do this by including an extension scope ('scop'
) resource in your extension. The extension scope resource is described in detail on page 6-26 in the chapter "Printing Resources."The scope of your printing extension can range from very general to quite specific. The scope of some extensions is known as universal scope, which means that the extension can run on any device. The scope of other extensions is defined in terms of the specific devices on which the extension can run. And the scope of yet other extensions is defined in terms of the specific devices on which the extension cannot run. Many extensions that affect only the final image on the printed page can be defined with universal scope.
There are three kinds of extension scope resources used in printing extensions, each of which has a unique ID defined for it. The constants for these IDs are shown in Table 2-6.
The declarations of these and other constants that are used in printing extension resources are shown in the section "Summary of Printing Resources" beginning on page 6-90 in the chapter "Printing Resources."
The background picture printing extension is compatible with all raster and PostScript printing devices. Its extension scope resource is defined as shown in Listing 2-21.
Listing 2-21 The extension scope resource for the background picture printing extension
resource gxExtensionScopeType (gxDriverScopeID,sysHeap, purgeable) { { 'post', /* compatible with PostScript printers */ 'rast' /* compatible with raster printers */ }; };You can include multiple extension scope resources in your printing extension file to pinpoint the devices on which the extension runs. Typically, you use one extension scope resource to define the imaging systems that your extension is compatible with, and you add other extension scope resources to include or exclude specific devices. Listing 2-22 includes three extension scope resources.Listing 2-22 An example of extension scope resources
resource gxExtensionScopeType (gxDriverScopeID, sysHeap, purgeable) { { 'vect'; /* compatible with all vector devices */ 'post'; /* compatible with all PostScript devices */ }; }; resource gxExtensionScopeType (gxPrinterScopeID, sysHeap, purgeable) { { 'lwsc'; /* also compatible w/Personal LaserWriter SC */ }; }; resource gxExtensionScopeType (gxPrinterExceptionScopeID,sysHeap, purgeable) { { 'odd1'; /* not compatible with odd1 device */ }; };The resources in Listing 2-22 indicate that the printing extension is compatible with all PostScript and vector devices except for the one that is identified as'odd1'
and with
no raster devices except for the Personal LaserWriter SC.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help